extends NodeState


var player: Player:
	get:
		return state_matchine.root as Player


func _on_process(_delta : float) -> void:
	pass



func _on_enter(data: NodeStateData) -> void:
	player.velocity = Vector2.ZERO

	process_anmiation()

	if data is PlayerShootingData and player.is_carrying_ball():
		player.ball.shoot(data.shot_power, player.shooting_power, data.shot_direction, player.ball.shot_height)



func _on_exit() -> void:
	pass



func process_shooting_finish():
	if player.input_manager.is_movement():
		transition_state(Player.STATE_RUN)
		return

	transition_state(Player.STATE_IDLE)


func process_anmiation():
	player.animation_player.play(Player.ANIMATION_KICK)


func on_animation_finished():
	process_shooting_finish()
